package Exception;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class FinallyCloseIO {
    public static void main(String[] args) {
        BufferedReader br=null;
        try {
            br=new BufferedReader(new InputStreamReader(
                    new FileInputStream("src/Exception/FinallyCloseIO.java")
            ));
            String str=null;
            while ((str=br.readLine())!=null){
                System.out.println(str);
            }
        }catch (Exception e){
            System.out.println("程序出错了");
        }finally {
            if (br!=null){
                try {
                    br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

        }

    }
}
